package com.guiguli.FileDemo;

import java.io.*;

public class CopyDemo {
    public static void main(String[] args) throws IOException {
        //读
        InputStream is = new FileInputStream("D:/汇编语言 第四版.pdf");
        //写
        OutputStream os = new FileOutputStream("D:/汇编.pdf");

        //定义一个字节数组转移数据
        byte[] buffer = new byte[1024];//一次拷贝1KB
        int len;
        while((len=is.read(buffer))!=-1){
            os.write(buffer,0,len);
        }
        //关闭
        os.close();
        is.close();
    }
}
